package com.googlecode.lohr.tools.language;

import lohr.lang.dom.CompilationUnit;
import lohr.lang.dom.LohrElement;

public class LohrCompilationError extends RuntimeException{
	private static final long serialVersionUID = 1L;
	
	
	private LohrElement _lohrElement;

	protected LohrCompilationError(String msg, LohrElement lohrElement) {
		super(msg);
		_lohrElement= lohrElement;
	}

	public LohrElement getLohrElement() {
		return _lohrElement;
	}

	public static LohrCompilationError MissingFile(CompilationUnit compilationUnit) {
		return new LohrCompilationError("A compilation unit must have an associated physical file in order to be compiled (because the file name determines the associated Java class name)", compilationUnit);
	}
}
